Bose-chaudhuri-hocquenchem (BCH) encoding and decoding tailored for redundant array of inexpensive disks (RAID)

ABSTRACT

A method of encoding generalized concatenated error-correcting codes includes providing a parity matrix {tilde over (H)} j  of a j-th layer code and predefined syndrome {tilde over (s)} of length n−{tilde over (k)} j , where the first n-k l  coordinates are zero, n is a length of a codeword c of a first layer BCH code C l  of dimension {tilde over (k)} j , codeword c satisfies {tilde over (H)} j c={tilde over (s)}, a first layer code includes only a BCH code, and each subsequent layer includes a Reed-Solomon (RS) stage followed by a BCH code; finding a square matrix R, of dimension (n−{tilde over (k)} j )(n−{tilde over (k)} j ) such that R j {tilde over (H)} j =(A|I), where A is an arbitrary matrix, R j =(Q j |T j ), where Q has n−k l  columns T j  and has k 1 −{tilde over (k)} j  columns; finding a vector c−(a b) where a is a vector of length {tilde over (k)} j  and b is a vector of length n−{tilde over (k)} j ; and solving 
                   (     A   |   I     )     ⁢     (         a           b         )       =         (       Q   j     |     T   j       )     ⁢     s   ~       =         T   j     ⁢   s   ⁢           ⁢   where   ⁢           ⁢   a     =       0   ⁢           ⁢   and   ⁢           ⁢   b     =       T   j     ⁢   s             ,         
where a=0 and b=T j s, and codeword c is nonzero only on the last n−{tilde over (k)} j =n−k j  bits.

TECHNICAL FIELD

Embodiments of the present disclosure are directed to methods of forming error correcting codes.

DISCUSSION OF THE RELATED ART

In coding theory, BCH codes form a class of cyclic error-correcting codes that are constructed using finite fields. BCH codes are named for their inventors Raj Bose, D. K. Ray-Chaudhuri, and Alexis Hocquenghem. BCH codes can be defined as follows. Let GF(q) be a finite field, where g is a prime power, and choose positive integers m, n, d, c such that 2≤d≤n, gcd(n, q)=1, and m is the multiplicative order of q modulo n. Further, let a be a primitive nth root of unity in GF(q^(m)), and let m_(l)(x) be the minimal polynomial over GF(q) of a_(i) for all i, The generator polynomial of the BCH code is the least common multiple g(x)=1 cm(m_(c)(x), . . . , m_(c+d−2)(x)). BCH codes allow a precise control over the number of symbol errors correctable by the code during code design. In particular, it is possible to design binary BCH codes that can correct multiple bit errors. BCH codes can also be easily decoded using an algebraic method known as syndrome decoding. This can simplify the design of the decoder for these codes by using small, low-power electronic hardware.

The syndrome of a received codeword y=x+e, where x is the transmitted codeword and e is an error pattern, is defined in terms of the parity matrix H. The parity check matrix of a linear code C is a generator matrix of the dual code C^(⊥), which means that a codeword c is in C iff the matrix-vector product Hc=0. Then, the syndrome of the received word y=x+e is defined as S=Hy=H(x+e)=Hx+He=0+He=He. Syndromes are useful in that the message polynomial drops out, and the length of S, the assumed number of errors L, is much less than the length of the codeword x itself.

The Berlekamp-Massey (BM) algorithm is an algorithm for decoding BCH codes that was originally developed to find the shortest linear feedback shift register (LFSR) for a given binary output sequence. The BM algorithm finds an error locator polynomial (ELP) C(x)=1+C_(l)x+C₂x²+ . . . +C_(L)x^(L) which results in all syndromes being equal to 0: S_(n)+C_(l)S_(n-1)+ . . . +C_(L)S_(n-L)=0, where L is the number of assumed errors, N is the total number of syndromes, and n is an index that ranges from 0 to (N−1), and L≤n≤N−1.

The BM algorithm begins by initializing C(x) to 1, L to zero; B(x) (a copy of the last C(x) since L was updated) to 1, b (a copy of the last discrepancy d since L was updated and initialized) to 1; and m (the number of iterations since L, B(x), and b were updated and initialized) to 1. The algorithm iterates from n=0 to N−1. At each iteration k of the algorithm, a discrepancy d is calculated: d=S _(k) +C _(l) S _(k-1) + . . . +C _(L) S _(k-L). If d is zero, C(x) and L are assumed correct for the moment, m is incremented, and the algorithm continues.

If d is not zero and 2L>n, C(x) is adjusted so that a recalculation of d would be zero: C(x)=C(x)−(d/b)x ^(m) B(x).

The x^(m) term shifts B(x) to follow the syndromes corresponding to b. If the previous update of L occurred on iteration j, then m=k−j, and a recalculated discrepancy would be: d=S _(k) +C _(l) S _(k-1)+ . . . −(d/b)(S _(j) +B ₁ S _(j−1)+ . . . ). This would change a recalculated discrepancy to: d=d−(d/b)b=d−d=0. Then, m is incremented, and the algorithm continues.

On the other hand, if d is not zero and 2L≤n, a copy of C is saved in vector T, C(x) is adjusted as above, B is updated from T, L is reset to (n+1−L), the discrepancy d is saved as b, m is reset to 1, and the algorithm continues.

Hard information for a received bit is the estimated bit value, i.e., 0 or 1, while “soft information” includes both an estimated value and the reliability of this estimation. This reliability may take many forms, but one common form is the probability, or an estimation of this probability, that the estimation is correct. For example, in the case of a single-level cell (SLC) flash memory, in which each cell stores a single bit, hard information is obtained with a single read (single threshold), while increasingly refined soft information is obtained from additional reads.

In hard-decision (HD) decoding, the hard-information vector (per-coordinate bit estimates) is used as the input of an error-correcting code (ECC) decoder, while in soft-decision (SD) decoding, a soft information vector (per-coordinate reliability vector on top of the hard-information vector) is used as the input of the ECC decoder.

Thus, soft information may be regarded as an estimate of the reliability of each bit estimate, on top of the bit estimates themselves. Hence, bits with a high enough reliability may be considered “strong”, while the remaining bits may be considered “weak”. For example, in an SLC flash memory, one read, e.g., with threshold level h, results in the HD vector, while two additional reads, e.g., with thresholds h+Δ, h−Δ, may be used to divide bits into strong and weak bits.

An exemplary encoding/decoding is depicted in FIG. 1, in which a weak BCH code is given by C_(w) ⊂F_(q) ^(n), the k_(w) information bits are x∈F_(q) ^(k) ^(w) , and the parity check matrix of the weak BCH is H_(w)∈F_(q) ^((n−k) ^(w) ^()×n). A stronger BCH C_(s) ⊂F_(q) ^(n) has parity check matrix H_(s)∈F_(q) ^((n−k) ^(s) ^()×n) given by:

$\begin{matrix} {{H_{s} = {\begin{pmatrix} H_{w} \\ H_{d} \end{pmatrix} \in F_{q}^{{({n - k_{s}})} \times n}}},} & (1) \end{matrix}$ where the number of rows of matrix H_(d) is (n−k_(s))−(n−k_(w))=k_(w)−k_(s), where the subscripts s, w, d respectively refer to strong, weal; and delta. The information data x∈F_(q) ^(k) ^(w) can be encoded and decoded with the weak code and also with the strong code. Trivially, the information data can be encoded and decoded with the weak code C_(w) ⊂F_(q) ^(n), and can be encoded and decoded with the strong code C_(s) ⊂F_(q) ^(n), as described herein below.

Information data x∈F_(q) ^(k) ^(w) can be encoded using a BCH code C_(w) to obtain the codeword c_({dot over (v)}), as illustrated in FIG. 2. The overhead of the strong code is given by H_(d)c_(w) as shown in FIG. 2. This additional overhead may reside on a different page. Note that the overhead stored for a strong code according to an embodiment is not a conventional BCH overhead but H_(d)c_(w) instead. However, the overall code is equivalent to a BCH code, as will be shown herein below. This overhead is protected by additional ECC, so that H_(d)c_(w) is clean from errors.

A read of c_(w) with errors yields: y=c _(w) +e.  (2) From y, the syndrome of the weak BCH can be computed: H _(w) y=H _(w) e.  (3) If the information can be decoded from syndrome, then the decoding is completed, otherwise, compute: H _(d) y−H _(d) c _(w) =H _(d) c _(w) +H _(d) e−H _(d) c _(w) =H _(d) e,  (4) since H_(d)c_(w) was saved in a protected form. Thus there exist both H_(w)e and H_(d)e and therefore, from EQ. (1):

$\begin{matrix} {{H_{s}e} = {\begin{pmatrix} H_{w} \\ H_{d} \end{pmatrix}e}} & (5) \end{matrix}$ Thus, decoding can be performed using the stronger BCH C_(s) with parity check matrix H_(s).

Example

Let the error probability of weak BCH be given by p=4.5×10⁻³; the correction capability be t=64; and the BCH frame error rate (fer) be q=bch_fer(p, 2¹³+64×14, t, 1), i.e., a function of the bit error rate p, length 2¹³+64×14, and error capability t. That is, the length of the BCH code is n=2¹³+64×14. Let, the error probability of the strong BCH is given by: p=4.5×10⁻³ ;t ₁=91;q ₁ =bch_fer(p,2¹³+64×14,t1,1) As in the weak BCH, the length of the BCH code is n=2¹³+64×14, but the correction capability is larger here and is determined by t₁=91.

Suppose that a weak BCH has error capability t_(w) and a strong BCH has error capability t_(s). Then the weak code uses the syndromes H_(w)e, and the strong BCH requires the syndromes of the weak BCH H_(w)e, as well as additional syndromes H_(d)e. The Berlekamp-Massey (BM) decoder works sequentially on the syndromes, that is, one syndrome after the other. Therefore, if a weak BCH fails, a decoding procedure of the strong BCH can resume from the same point. It will not be necessary to start decoding the strong BCH from the beginning, and it is therefore more efficient. In contrast, other decoding algorithms, such as Euclidian decoding, work simultaneously on all syndromes. Therefore, decoding of weak BCH and strong BCH codes is performed separately, and consequently will be more time consuming.

SUMMARY

Exemplary embodiments of the disclosure as described herein are directed to an encoding method for generalized concatenated codes tailored for using RAID on a function of a codeword, instead of on the codeword itself. According to embodiments of the disclosure, vectors are calculated with prescribed syndromes by using properties that the code is linear and cyclic, and using matrix manipulation of polynomials to find a systematic encoder that saves computations and required memory.

According to an embodiment of the disclosure, there is provided a computer implemented method of encoding generalized concatenated error-correcting codes, including receiving a codeword {tilde over (C)}_(j) comprising n_(r) rows, wherein n_(r)>=1, of n bits each with k_(M) information bits, k_(M)<n, n>=1, wherein codeword {tilde over (C)}_(j) is a code with parity check matrix

${\overset{\sim}{H}}_{j} = \begin{pmatrix} H_{1} \\ {\overset{\sim}{\Delta}}_{21} \\ {\overset{\sim}{\Delta}}_{32} \\ \vdots \\ {\overset{\sim}{\Delta}}_{{j - 1},j} \end{pmatrix}$ wherein matrix H₁ is the parity check matrix of code C₁, matrix

${{\overset{\sim}{\Delta}}_{{j - 1},j} = \begin{pmatrix} \Delta_{{j - 1},j} \\ {ext}_{j} \end{pmatrix}},$ where {tilde over (Δ)}t_(j−1,j) has L_(j) rows and ext_(j) has L_(j)−δ_(j) rows, and matrix Δ_(j−1,j) represents the additional checks for codewords in C_(j) that are not in C_(j−1) and has δ_(j) rows; partitioning the k_(M) information bits into n, blocks, wherein each layer comprises k_(j+1) ^(RS)−k_(j) ^(RS) blocks of {tilde over (k)}_(j) bits each for j=2, . . . , L, wherein L is a number of layers of weak BCH code C₁, wherein each layer, except for a first layer, comprises a Reed Solomon (RS) stage followed by a BCH code, and the first layer includes only a BCH code, and {tilde over (k)}_(j) is a dimension of codeword {tilde over (C)}_(j); encoding a first k₂ ^(RS) blocks with a with code C₁ and computing syndromes S_(ij)={tilde over (Δ)}S_(j)(x_(i)) wherein a vector of syndromes

(S₁₂, …  , S_(k₂^(RS), 2)) is information encoded by Reed Solomon code RS₂, wherein a resulting RS₂ codeword is given by

(S₁₂, …  , S_(k₂^(RS), 2), S_(k₂^(RS) + 1, 2), …  , S_(n_(r), 2)); transforming information blocks of size {tilde over (k)}_(j), for j=2, . . . , L and i∈{k_(j) ^(RS)+1, . . . , k_(j+1) ^(RS)} into blocks u_(i), i=1 to n_(r), of size k_(j) using zero padding in coordinates specified by unit vectors; encoding block u_(i) with an encoder for C to compute codeword x_(i); calculating a vector b of length n−{tilde over (k)}_(j) from

${b = {T_{j}\begin{pmatrix} S_{i\; 2} \\ \vdots \\ S_{i\; j} \end{pmatrix}}},$ wherein matrix T_(j) is defined by R_(j)=(Q_(j)|T_(j)), where Q has n−k_(l) columns, T_(j) has k₁−{tilde over (k)}_(j) columns, and R_(j) is a square matrix of dimension (n−{tilde over (k)}_(j))(n−{tilde over (k)}_(j)) such that R_(j){tilde over (H)}_(j)=(A|I), wherein A is an arbitrary matrix, I is an identity matrix, {tilde over (H)}_(j) is a parity matrix of codeword {tilde over (C)}_(j); updating codeword x_(i) according to

${\left. x_{i}\leftarrow{x_{i} + \begin{pmatrix} 0 \\ \vdots \\ 0 \\ b \end{pmatrix}} \right. = {\begin{pmatrix} x_{1} \\ \vdots \\ x_{{\overset{\sim}{k}}_{j}} \\ x_{{\overset{\sim}{k}}_{j} + 1} \\ \vdots \\ x_{n} \end{pmatrix} + \begin{pmatrix} 0 \\ \vdots \\ 0 \\ b_{1} \\ \vdots \\ b_{n - {\overset{\sim}{k}}_{j}} \end{pmatrix}}};$ and computing syndromes S_(ij), ={tilde over (Δ)}S_(j),(x_(i)) for j′=j+1, . . . , L, wherein a resulting RS_(j+1) codeword is given by

(S_(1, j + 1), …  , S_(k_(j + 1)^(RS), j + 1)S_(k_(j + 1)^(RS) + 1, j + 1), …  , S_(n_(r), j + 1))  for  j <  = L − I. for j<=L−1.

According to a further embodiment of the disclosure, the method includes, if parity matrix {tilde over (H)}_(j) is not a full rank matrix, calculating a full rank parity matrix H′_(j) from one of {tilde over (H)}_(j) if a degree of a minimum polynomial for each element is m, wherein m is defined from a length n of a primitive binary BCH code associated with said parity matrix {tilde over (H)}_(j) by n=2^(m−1), and H′_(i) with rank(H₁)=deg(P_(α) _(i) ) rows if the degree of the minimal polynomial is less than m, wherein P_(α) _(i) (x) is the minimal polynomial of α¹ over the binary field and a generator polynomial of {tilde over (H)}_(j) is g₁(x)=LCM(P_(α) _(i) (x)|i∈I).

According to an embodiment of the disclosure, there is provided a computer implemented method of encoding generalized concatenated error-correcting codes, including providing a parity matrix {tilde over (H)}_(j) of a j-th layer code and predefined syndrome {tilde over (s)}, wherein syndrome g is a vector

$\overset{\sim}{s} = \begin{pmatrix} 0 \\ s \end{pmatrix}$ of length n−{tilde over (k)}_(j), in which the first n−k_(l) coordinates are zero, wherein s is a vector of length k₁−{tilde over (k)}_(j), wherein n is a length of a codeword c of a first layer BCH code C_(l) of dimension {tilde over (k)}_(j), wherein codeword c satisfies {tilde over (H)}_(j)c={tilde over (s)}, wherein a first layer code includes only a BCH code, and each subsequent layer includes a Reed-Solomon (RS) stage followed by a BCH code; finding a square matrix R_(j) of dimension (n−{tilde over (k)}_(j))(n−{tilde over (k)}_(j)) such that R_(j){tilde over (H)}_(j)=(A|I), wherein A is an arbitrary matrix and I is the identity matrix, wherein R_(j)=(Q_(j)|T_(j)), where Q has n−k_(l) columns and T_(j) has k₁−{tilde over (k)}_(j) columns; finding a vector c=(a b) wherein a is a vector of length {tilde over (k)}_(j) and b is a vector of length n−{tilde over (k)}_(j); and solving

${{\left( A \middle| I \right)\begin{pmatrix} a \\ b \end{pmatrix}} = {{\left( Q_{j} \middle| T_{j} \right)\overset{\sim}{s}} = {{T_{j}s\mspace{14mu}{wherein}\mspace{14mu} a} = {{0\mspace{14mu}{and}\mspace{14mu} b} = {T_{j}s}}}}},$ wherein a=0 and b=T_(j)s, wherein codeword c is nonzero only on the last n−{tilde over (k)}_(j)=n−k_(j) bits.

According to an embodiment of the disclosure, there is provided a computer processor configured to execute a program of instructions to perform the method steps for encoding generalized concatenated error-correcting codes, wherein the computer processor is one or more of an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), or firmware.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 depicts an exemplary encoding/decoding of a weak BCH code, according to an embodiment of the disclosure.

FIG. 2 illustrates how information data can be encoded using a BCH code to obtain a codeword c_({dot over (w)}), according to an embodiment of the disclosure.

FIG. 3 illustrates how N bits of information to code can be distributed among n_(r) blocks, according to an embodiment of the disclosure.

FIG. 4 illustrates syndromes, according to an embodiment of the disclosure.

FIG. 5 illustrates how an encoder computes and stores codewords, according to an embodiment of the disclosure.

FIG. 6 illustrates decodings that failed, according to an embodiment of the disclosure.

FIG. 7 illustrates the computing of syndromes for successfully decoded codewords, according to an embodiment of the disclosure.

FIG. 8 illustrates the computation of the syndrome for a successfully decoded codeword, according to an embodiment of the disclosure.

FIG. 9 illustrates how a codeword can be found from the syndrome, according to an embodiment of the disclosure.

FIG. 10 illustrates the partitioning of bits of information into non-equal blocks, according to an embodiment of the disclosure.

FIG. 11 illustrates the pre-computation of the first blocks of matrices T_(j) with code C_(l), according to an embodiment of the disclosure.

FIG. 12 illustrates the computation of syndromes for j=2, . . . , L, according to an embodiment of the disclosure.

FIG. 13 illustrates the resulting RS₂ codeword, according to an embodiment of the disclosure.

FIG. 14 illustrates the transformation of information blocks of size {tilde over (k)}_(j) into blocks of size k_(j) using zero padding, according to an embodiment of the disclosure.

FIG. 15 illustrates the computation of codeword x_(i) using code C_(i), according to an embodiment of the disclosure.

FIG. 16 illustrates the updating of the codeword x according to an embodiment of the disclosure.

FIG. 17 is a flowchart of an encoding method according to an embodiment of the disclosure.

FIG. 18 is a flowchart of a decoding method according to an embodiment of the disclosure.

FIG. 19 is a block diagram of a machine for encoding and decoding BCH codes tailored for a RAID, according to an embodiment of the disclosure.

DETAILED DESCRIPTION OF EXEMPLARY EMBODIMENTS

Exemplary embodiments of the invention as described herein generally provide systems and methods for encoding and decoding BCH codes tailored for a RAID. While embodiments are susceptible to various modifications and alternative forms, specific embodiments thereof are shown by way of example in the drawings and will herein be described in detail. It should be understood, however, that there is no intent to limit the invention to the particular forms disclosed, but on the contrary, the invention is to cover all modifications, equivalents, and alternatives falling within the spirit and scope of the invention.

According to embodiments of the disclosure, there is provided a new projected BCH coding scheme that achieves superior performance relative to standard BCH code. According to an embodiment, instead of using RAID on an entire codeword, RAID is used only on a function of the codeword. This function, because it is also linear, is referred to hereinbelow as a projection. For a projected BCH according to an embodiment for a double-layered case; embodiments assume there is a weak BCH code C_(w) and a strong BCH code C_(s). These codes will be referred to herein below as C₁ and C₂, respectively. According to embodiments, the condition C₁⊃C₂ holds, that is, every codeword of the strong code C₂ is also a codeword of the weak code C₁.

According to an embodiment, suppose there are N bits of information to code. These bits can be distributed among n_(r) blocks, as illustrated in FIG. 3. In FIG. 3, x¹ ₁-x¹ ₄ are codewords of length n of a weak BCH code C₁ and x² ₁-x² ₃ are codewords of length n of strong code C₂. For code C₁(n, k_(l), d_(l)) and C₂(n, k₂, d₂), k₁>k₂ and d₁<=d₂. In these codes, n is the length of the code, k_(i) is the dimension of the code, and d_(i) is the minimal distance. The parity checks matrices of C₁ and C₂ are H₁ and H₂, respectively. The parity check matrix H₂ of the stronger code can be written as a concatenation of H₁ and another matrix H_(Δ):

$H_{2} = {\begin{pmatrix} H_{1} \\ H_{\Delta} \end{pmatrix}.}$

According to embodiments, continuing with the example of FIG. 3, since x¹ ₁-x¹ ₄ are codewords of C₁, an encoder can compute their syndromes based on Ha. As shown in FIG. 4, the syndromes are given by S _(i) =H _(Δ) x _(i) ¹ ,i=1, . . . ,4. If the x² ₁-x² ₃ syndrome is computer based on H_(Δ), the result is the zero vector, since these are codewords of the strong code C₂, so these are not computed at the encoder. According to embodiments, the encoder can be any standard encoder as is known in the art, such as a BCH encoder or an RS encoder.

However, according to embodiments, the syndromes S_(i) can be treated as symbols that are encoded using RS codes. In the example of FIG. 3, use RS (n=7, k=4, d=4). The RS redundancy symbols are denoted in the figure by RS₁, RS₂, RS₃. The symbols of the RS code are not explicitly stored by the encoder. Instead, the encoder finds a codeword w_(i) of the code C₁, that has RS_(i), i=1, 2, 3 as its syndrome according to H_(Δ): H _(Δ) w _(i)=RS_(i) ,i=1,2,3. It will be shown below it is always possible to find w_(i). For now, embodiments assume there is a simple lookup table that maps each syndrome into a codeword. The encoder computes and stores, shown in FIG. 5: z ₁ =x ₁ ² +w ₁. z ₂ =x ₂ ² +w ₂. z ₃ =x ₃ ² +w ₃. Because both x² ₁ and w₁ are codewords of C₁, so is z₁. Similarly, so are z₂ and z₃.

At the output of the BSC channel, each codeword has noise added to it. A decoder according to an embodiment starts by attempting to decode the codewords of C₁: x¹ ₁-x¹ ₄, z₁-z₃. If at least 4 of the decoding attempts successful, then the RS stage will succeed. For codewords x₁ ¹-x¹ ₄: if decoding succeeds, then the syndromes S_(i)=H_(Δ)x_(i) ¹ can be computed and used to decode RS. For codeword z₁-z₃: if decoding succeeds, then the syndromes S_(i)=H_(Δ)z_(i), i=1, 2, 3 can be computed. Since x² ₁-x² ₃, are codewords of C₂ then H_(Δ)x_(i) ²=0, i=1, 2, 3. It follows that H_(Δ)z_(i)=H_(Δ)w_(i), i=1, 2, 3. Thus, given the syndrome, the codeword w_(i) can be found in C₁. This can be carried out by a lookup table that maps any given syndrome into a codeword of C₁. The codeword w_(i) can be subtracted from z, to obtain the codeword x_(i) ². The syndrome H_(Δ)z_(i)=H_(Δ)w_(i) can be used for the RS decoding.

If at least 4 codewords were successfully decoded, the RS can be successfully decoded. However, according to an embodiment, if codeword x¹ ₁-x¹ ₄ are not successfully decoded at the first layer, the syndrome H_(Δ)x_(i) that was decoded using the RS decoding can be used to decode it using the stronger code C₂. The syndrome can be used for syndrome decoding, in a similar manner to what was described above for a projected BCH according to an embodiment. In addition, if codeword z₁-z₃ was not successfully decoded at the first layer, the syndrome H_(Δ)w_(i) that was decoded using the RS decoding can be used to find w, using a lookup table. Then, the w_(i) can be subtracted from z_(i)+e² _(i), where e² _(i) is the noise added to the respective codeword, to obtain x_(i) ²+e_(i) ², which can be decodes to find x_(i) ² using a decoder according to an embodiment for the strong code, since x_(i) ² is a codeword of C₂.

For example, referring to FIG. 6, after first decoding all codewords with code C₁, assume that the decoding of x₂ ¹, z₁, z₃, fail. These are crossed out in the figure. For the successfully decoded codewords x₁ ¹, x₃ ¹ and x₄ ¹, the syndrome S_(i)=H_(Δ)x_(i) ¹, i=1, 3, 4 can be computed, as shown in FIG. 7. For the successfully decoded z₂, the syndrome H_(Δ)w₂=RS₂ can be computed, as shown in FIG. 8. From the syndrome H_(Δ)w₂=RS₂, w₂ can be found and subtracted from z₂ to get x₂ ², as shown in FIG. 9. The RS code can be used to obtain all the missing syndromes. Decoding x₁ ² can be attempted using syndrome decoding with code C₂. w₁ and w₃ can be found from RS₁ and RS₃, respectively: w_(i) can be subtracted from z_(i)+e_(i) ², i=1, 3, and x_(i) ²x² _(i) can be decoded using a decoder for C₂.

Multi-Layer BCH Encoding/Decoding: Preliminaries

Further embodiments of the disclosure provide a general multi-layer scheme for BCH encoding/decoding. According to embodiment, the following notations and preliminaries will be defined as follows.

L is the number of layers;

Each layer, except the first one, is composed of an RS stage followed by the BCH code;

The first layer includes only a BCH code;

n is the length of each block;

n_(r) is the number of blocks;

Layer j is associated with the BCH code C_(j);

{C_(i)} is a set of binary linear codes of length n that maintain C₁ ⊃C₂ . . . ⊃C_(L), i.e., C₁ is the weakest code;

d_(j) is the minimum distance of code c_(j), where the codes maintain: d₁≤d₂≤ . . . ≤d_(L)

k_(j) is the dimension of code C_(j);

$t_{j} = \left\lfloor \frac{d_{j} - 1}{2} \right\rfloor$ is the correction capability of code C_(j);

δ_(j)=k_(j−1)=k_(j) is the difference between dimensions;

The parity check matrix of code C_(j) can be written in the form

${H_{j} = \begin{pmatrix} H_{1} \\ \Delta_{21} \\ \Delta_{32} \\ \vdots \\ \Delta_{j,{j - 1}} \end{pmatrix}},$ where H₁ is the parity check matrix of code C₁;

The matrix Δ₂₁ represents the additional checks for codewords in C₂ that are not in C₁;

the parity check matrix is assumed to be full rank; and

the delta syndrome of a binary vector x of length n is defined as ΔS_(j)(x)=Δm_(j,j−1)·x.

According to embodiments, for RS codes, the following preliminaries apply.

For layer j, j=2, . . . , L, there is also an RS code. The RS code is not necessarily binary, and may be shortened. For layer j, there is an integer L_(j)≥δ_(j), such that L_(j)≥n_(r). L_(j) will be the size (in bits) of each symbol of the RS code. The field size of the RS will be 2^(L) ^(j) . L_(j)≥n_(r), because the length of the RS code is n_(r), since for an RS of length N, the field size has to be at least N. According to embodiments, a minimal possible field size can be chosen, that is L_(j)=δ_(j). According to embodiments, L_(j)>δ_(j) when n, is too large for field size 2^(δ) ^(j) . For example, suppose n_(r)=34 and δ_(j)=5. There cannot be L_(j)=5, because the maximal length of RS code for field size 32 is 32, which is less than 34. Note that when δ_(j) is large, several RS codes may be implemented for the same layer j for practical reasons to reduce field size. RS_(j) is a (possibly shortened) RS code for layer j with dimension k_(j) ^(RS) and length n_(r). A minimum distance of code RS_(j) is d_(j) ^(RS). Because RS is a maximum distance separable (MDS) code, d_(j) ^(RS)=n_(r)−k_(j) ^(RS)+1. According to embodiments, it is assumed that k₂ ^(RS)≤ . . . ≤k_(L) ^(RS). Note that although different RS codes may be defined over different fields, they have the same length n_(r).

According to embodiments, the following preliminaries apply for an extended panty matrix. Recall that the matrix Δ_(j,j−1) has δ_(j) rows. Because an RS code is defined over symbols of L_(j)≥δ_(j), there may be a need to extend the syndrome matrices to the size that will be at least the size of the RS symbols

${{\overset{\sim}{\Delta}}_{{j - 1},j} = \begin{pmatrix} \Delta_{{j - 1},j} \\ {ext}_{j} \end{pmatrix}},$ where {tilde over (Δ)}_(j−1,j) has L_(j) rows and ext_(j) has L_(j)−δ_(j) rows. The code {tilde over (C)}_(j) can be defined to be the code with parity check matrix

${\overset{\sim}{H}}_{j} = {\begin{pmatrix} H_{1} \\ {\overset{\sim}{\Delta}}_{21} \\ {\overset{\sim}{\Delta}}_{32} \\ \vdots \\ {\overset{\sim}{\Delta}}_{{j - 1},j} \end{pmatrix}.}$ The condition is that the matrix below is full rank

${\overset{\sim}{H}}_{L} = {\begin{pmatrix} H_{L} \\ {ext}_{2} \\ {ext}_{3} \\ \vdots \\ {ext}_{L} \end{pmatrix}.}$ Because all the rows of H_(j) appear also in {tilde over (H)}_(j) it follows that the correction distance of {tilde over (C)}_(j) is at least the distance of C_(j). A decoder of C_(j) can be sued to decode words of {tilde over (C)}_(j) up to the correction capability t_(j). The dimension of the code {tilde over (C)}_(j) is given by

${\overset{\sim}{k}}_{j} = {k_{j} - {\sum\limits_{r = 2}^{j}{\left( {L_{r} - \delta_{r}} \right).}}}$ Similarly to the previous delta syndrome function for C_(j), a syndrome can be defined for {tilde over (C)}_(j) by {tilde over (Δ)}S_(j)(x)={tilde over (Δ)}_(j,j−1)·x.

According to an embodiment, a codeword of a large code C_(M) is composed of blocks of n_(r) rows, where each block has length n:

$x = {\begin{pmatrix} x_{1} \\ x_{2} \\ \vdots \\ x_{n_{r}} \end{pmatrix}.}$ The blocks of length n are denoted by x₁, x₂, . . . , x_(n) _(r) . The blocks satisfy the following conditions: (1) All blocks are codewords of C₁: x₁, x₂, . . . , x_(n) _(r) ∈C_(l); and (2) For each layer j, the set of the syndromes of the blocks is a codeword of the RS_(j) code: j=2, . . . , L:({tilde over (Δ)}S_(j)(x_(i)), . . . , {tilde over (Δ)}S_(j)(x_(n) _(r) ))∈RS_(j).

According to an embodiment, an undetected error (UED) is defined as follows. For a linear code C with error capability t, a vector v in the vector space is an undetected error if there is a nonzero codeword c in C such that the distance between c and v is less than the error capability.

A BCH code according to embodiments has the following properties.

The length of the code is n_(r)·n.

The dimension of the code is k _(M) =k ₁ ^(RS)+(k ₂ ^(RS) −k ₃ ^(RS)){tilde over (k)} ₂+ . . . +(k _(L) ^(RS) −k _(L−1) ^(RS)){tilde over (k)} _(L−1)+(n _(r) −k _(L) ^(RS)){tilde over (k)} _(L).

A decoding capability of the code is as follows:

Define an error matrix e, similar to the definition of the code matrix:

$e = {\begin{pmatrix} e_{1} \\ e_{2} \\ \vdots \\ e_{n_{r}} \end{pmatrix}.}$ For j=2, . . . , L+1, define: ε_(j)(e)=|{|wt(e_(i))≥t_(j−1)+1 and e_(i) is not UED for C_(j−1)}| where wt( ) is Hamming weight, and φ_(j)(e)=|{i|e_(i) is a UED for C_(j−1)}|. A decoding according to an embodiment will be successful if the following condition on the error matrix is satisfied, for j=1, . . . , L: ε_(j)(e)+2φ_(j)(e)≤d _(j) ^(RS)−1, and ε_(L+1)(e)=φ_(L+1)(e)=0. Encoding and Decoding the Code

Embodiments of the disclosure can find a codeword c of code C₁ with a predefined syndrome {tilde over (s)}, that is: {tilde over (H)} _(j) c={tilde over (s)}. The syndrome {tilde over (s)} is a vector of length n−{tilde over (k)}_(j), in which the first n−k_(l) coordinates are zero. That is, the vector is in the form:

$\overset{\sim}{s} = \begin{pmatrix} 0 \\ s \end{pmatrix}$ where s is a vector of length k₁−{tilde over (k)}_(j). Lemma:

For a cyclic code of length n and dimension k, any k cyclically consecutive coordinates can be taken as information symbols.

According to embodiments, there exists a square matrix R_(j) of dimension (n−{tilde over (k)}_(j))(n−{tilde over (k)}_(j)) such that R _(j) {tilde over (H)} _(j)=(A|I), where A is an arbitrary matrix and I is the identity matrix. The matrix R_(j) should be be full rank, since it has an inverse matrix. The relationship {tilde over (H)}_(j)c={tilde over (s)} can be used to obtain an equivalent relationship: R _(j) {tilde over (H)} _(j) c=R _(j) {tilde over (s)}. R_(j) can be written as: R _(j)=(Q _(j) |T _(j)), where Q has n−k_(l) columns and T_(j) has k₁−{tilde over (k)}_(j) columns.

According to an embodiment, for some vector a of length {tilde over (k)}_(j) and some vector b of length n−{tilde over (k)}_(j), there is a vector c=(a b). Substituting everything:

${\left( A \middle| I \right)\begin{pmatrix} a \\ b \end{pmatrix}} = {{\left( Q_{j} \middle| T_{j} \right)\overset{\sim}{s}} = {T_{j}{s.}}}$ According to an embodiment, a=0 and b=T_(j)s. This choice leads to a systematic coding, i.e., a coding that includes the information bits as well as the coded bits, described below. The length of b is n−{tilde over (k)}_(j) and it follows that the codeword c may be nonzero only on the last n−

${\overset{\sim}{k}}_{j} = {n - k_{j} + {\sum\limits_{r = 2}^{j}\left( {L_{r} - \delta_{r}} \right)}}$ coordinates. If c is added to a codeword in {tilde over (c)}∈{tilde over (C)}_(j), with parity check matrix {tilde over (H)}_(j), then the resulting codeword c+{tilde over (c)} will also maintain the relationship {tilde over (H)}_(j)c={tilde over (s)}, because the codeword {tilde over (c)} is in C_(l), and therefore c+{tilde over (c)} is also in C_(l). Since {tilde over (c)}∈{tilde over (C)}_(j), the syndrome, with parity check matrix {tilde over (H)}_(j), of {tilde over (c)} is zero by definition, and thus the syndrome of c+{tilde over (c)}∈C₁ is {tilde over (s)}. Because codeword c may be nonzero only on the last

${{n - {\overset{\sim}{k}}_{j}} = {n - k_{j} + {\sum\limits_{r = 2}^{j}{\left( {L_{r} - \delta_{r}} \right)\mspace{14mu}{bits}}}}},$ to generate c+{tilde over (c)} from {tilde over (c)}, at most the last

${n - {\overset{\sim}{k}}_{j}} = {n - k_{j} + {\sum\limits_{r = 2}^{j}\left( {L_{r} - \delta_{r}} \right)}}$ coordinates of {tilde over (c)} will need to be modified Encoding {tilde over (C)}_(j) with an Encoder for C_(j)

Recall that the constraint on the matrices ext_(j) is that the following matrix is full rank:

${{\overset{\sim}{H}}_{L} = \begin{pmatrix} H_{L} \\ {ext}_{2} \\ {ext}_{3} \\ \vdots \\ {ext}_{L} \end{pmatrix}},$ where the rows of the matrices ext_(j) are unit vectors.

According to an embodiment, the information set of a linear code is a set of k bits such that the k information bits can be mapped into these coordinates and the projection from C is onto, which means that the columns in the generator matrix associated with the k coordinates are independent. If the matrix ext_(j) contains unit vectors with coordinates within an information set, then encoding {tilde over (C)}_(j) is as follows:

-   -   (1) Take the information vector of code {tilde over (C)}_(j) and         length {tilde over (k)}_(j) and append zeros in the coordinates         specified by the unit vectors; and     -   (2) Encode the resulting vector of length k_(j) with the encoder         for C_(j).

Recall that a codeword c for a predetermined syndrome may be nonzero only on the last

${n - {\overset{\sim}{k}}_{j}} = {n - k_{j} + {\sum\limits_{r = 2}^{j}\left( {L_{r} - \delta_{r}} \right)}}$ coordinates. If the forced zero coordinates for {tilde over (C)}_(j) were at the end of the information for C_(j), that is in the range

$\left\{ {{k_{j} - {\sum\limits_{r = 2}^{j}\left( {L_{r} - \delta_{r}} \right)} + 1},\ldots\mspace{14mu},k_{j}} \right\},$ then the information coordinates

$\left\{ {1,\ldots\mspace{14mu},{\overset{\sim}{k}}_{j}} \right\} = \left\{ {1,\ldots\mspace{14mu},{k_{j} - {\sum\limits_{r = 2}^{j}\left( {L_{r} - \delta_{r}} \right)}}} \right\}$ would not be affected by adding c. But for j<L, the zeros will not be forced at the end of the information, but on a different set of the same size, and therefore the information coordinates will be affected by adding c. The resulting encoding is not systematic, but the computational cost at the decoder is typically small. Encoding for Full Rank Parity Check Matrices

According to an embodiment of the disclosure, there is a systematic encoder for C_(j), denoted by Enc_(j). A systematic encoder is an encoder that outputs the information bits, as well as the coded bits, so that the original information bits always appear in the codeword. The encoding for {tilde over (C)}_(j) can be performed using the encoder for C_(j), as explained above, by padding zeros at the end of the information. The k_(M) bits of information are then partitioned into non-equal blocks, as shown In FIG. 10. Referring to the figure, there are k_(j+1) ^(RS)−k_(j) ^(RS) blocks of {tilde over (k)}_(j) bits each. The encoder also pre-computes the matrices T_(j), j=2, . . . , L of dimension (n−{tilde over (k)}_(j))×(k₁−{tilde over (k)}_(j)). An encoding algorithm according to an embodiment of the disclosure is illustrated in FIG. 17. Referring to the figure, an encoding algorithm beings by receiving Receive a codeword {tilde over (C)}_(j) of k_(M) information bits, at step 171. At step 172, for the first K₂ ^(RS) blocks, encode x_(i)=ENC₁(u_(i)) with code C₁, as illustrated in FIG. 11. Then, for j=2, . . . , L compute the syndromes S_(ij)={tilde over (Δ)}S_(j)(x_(i)), as illustrated in FIG. 12. The vector of the syndromes

(S₁₂, …  , S_(k₂^(RS), 2)) is now treated as the information to be encoded by RS₂, where each symbols of the vector consists L₂ bits (or is from an alphabet of size 2^(L) ² ). The resulting RS₂ codeword is given by

(S₁₂, …  , S_(k₂^(RS), 2), S_(k₂^(RS) + 1, 2), …  , S_(n_(r), 2)), as illustrated in FIG. 13. Next, at step 173, for j=2, . . . , L, for i∈{k_(j) ^(RS)+1, . . . , k_(j+1) ^(RS)}, the information blocks of size {tilde over (k)}_(j) are transformed into blocks u_(i) ⁺ of size k_(j) using zero padding and as shown in FIG. 14. Then, at step 174, x_(i)=ENC_(i)(u_(i) ⁺) is computed using code C_(i), as illustrated in FIG. 15. A vector b of length n−{tilde over (k)}_(j) is calculated at step 175:

${b = {T_{j}\begin{pmatrix} S_{i\; 2} \\ \vdots \\ {S_{i\; j}\;} \end{pmatrix}}},$ and the codeword x_(i) is updated at step 176 according to:

${\left. x_{i}\leftarrow x_{i} \right. = {\begin{pmatrix} 0 \\ \vdots \\ 0 \\ b \end{pmatrix} = {\begin{pmatrix} x_{1} \\ \vdots \\ x_{{\overset{\sim}{k}}_{j}} \\ x_{{\overset{\sim}{k}}_{j} + 1} \\ \vdots \\ x_{n} \end{pmatrix} + \begin{pmatrix} 0 \\ \vdots \\ 0 \\ b_{1} \\ \vdots \\ {b_{n - {\overset{\sim}{k}}_{f}}\;} \end{pmatrix}}}},$ as illustrated in FIG. 16. For j′=j+1, . . . , L the syndromes can be computed from S_(ij′)={tilde over (Δ)}S_(j′)(x_(i)). If j<=L−1, a systematic encoder RS_(j+1) according to an embodiment can be used to encode the information vector of the syndromes

(S_(1, j + 1), …  , S_(k_(j + 1)^(RS), j + 1)) into a resulting RS_(j+1) codeword at step 177 given by:

(S_(1, j + 1), …  , S_(k_(j + 1)^(RS), j + 1), S_(k_(j + 1)^(RS) + 1, j + 1), …  , S_(n_(r), j + 1)). Decoding for Full Rank Parity Check Matrices

According to an embodiment, there is a decoder for C_(j) given by Dec_(j) for j=1, . . . , L. As in the case of the encoder, the decoder can be any standard decoder as is known in the art, such as BCH decoder or an RS decoder. According to embodiments, the inputs to the decoders are the syndromes and the output is an error vector. The input syndrome is a binary vector of length n−k_(j), and the output is a binary error vector of length n or failure. Failure occurs when there is no codeword of distance at most t_(j) from the received codeword. A decoder according to an embodiment can decode all error patterns defined in the properties of the code.

A decoding algorithm according to an embodiment takes as input a received binary matrix with n_(r) rows and n_(c) columns, where y_(i) is given by row i, and the output is a binary vector u of length k_(M) or failure. The vector u is a correct information vector if the error matrix has the error patterns defined in the properties of the code. If an error is detected the output is failure.

FIG. 18 is a flow chart of a decoding algorithm according to an embodiment of the disclosure. A decoding algorithm according to an embodiment begins at step 180 by receiving the binary matrix with n_(r) rows and n_(c) columns, and continues at step 181 by calculating the syndromes S_(i1)=H₁y_(i) for all rows i=1, . . . , n_(r) and set the output error patterns ê_(i)=Dec₁(S_(i1)). If the number of decoder failures is larger than d_(RS) ², then the output of the decoder is failure. The outputs of the decoders of stage 1 are partitioned at step 182 into two sets: failures and non-failures: I _(F) ={i|ê _(i)=failure}, I _(N) ={i|ê _(i)≠failure}. For all rows with non-failures, the decoded codeword {circumflex over (x)}_(i)=y_(i)+ê_(i) and the syndromes {tilde over (Δ)}S₂({circumflex over (x)}_(i)) can be calculated for all rows. If the set of syndromes is already a codeword of RS₂, the decoded error vectors can be added to the received rows and u can be output as the vector of information at step 183.

According to embodiments, in a general case, errors and erasures can be used for decoding for RS₂ with erasures on I_(F), and the syndromes {tilde over (Δ)}S₂({circumflex over (x)}_(i)) are recovered for all rows. If RS detects an error, declare error.

In a practical decoder according to embodiments, if the RS decoder corrected an error at a certain row in I_(N), then that row is considered to be in I_(F). Then, for all i, i.e., for rows in I_(F), the last L_(i)−δ_(i) entries of {tilde over (Δ)}S₂({circumflex over (x)}_(i)) are deleted to get ΔS₂({circumflex over (x)}_(i)), ΔS₂(y_(i)) is calculated, and ΔS₂(ê_(i))=ΔS₂(y_(i))+ΔS₂({circumflex over (x)}_(i)) is calculated, after which there is S_(i2)=H₂ê_(i) for all rows.

Referring again to FIG. 18, a decoding algorithm continues, for stages j=2, . . . , L, at step 184 by, for each row i, calculating the estimated error with the new syndrome ê_(i)=Dec_(j)(S_(ij)). If, at step 185, the number of decoder failures is larger than d_(RS) ^(j+1), the output of the decoder is declared to be failure (in the last stage no failures are allowed), and sets I_(N) and I_(F) are updated. At step 186, for all rows with non-failures, the decoded codeword is {circumflex over (x)}_(i)=y_(i)+ê_(i), and if j<L, the syndrome {tilde over (Δ)}S_(j+1)({circumflex over (x)}_(i)) is calculated, otherwise if j=L, the estimated error is added to the received row to get an estimated 2_(i) and the estimated information u is output. If, at step 187, there are still rows with failures, output failure.

In a practical decoder according to embodiments, if the RS decoder corrected an error at a certain row in I_(N), then that row is considered to be in I_(F). Then, for all i, the last L_(i)−δ_(i) entries of {tilde over (Δ)}S_(j+1)({circumflex over (x)}_(i)) are deleted to get ΔS_(j+1)({circumflex over (x)}_(i)), ΔS_(j+1)(y_(i)) is calculated, and {tilde over (Δ)}S_(j+2)(e_(i))={tilde over (Δ)}S_(i+1)(y_(i))+ΔS_(2j+2)({circumflex over (x)}_(i)) is calculated. According to an embodiment, there are now S_(i,j+1)=H_(j+1)ê_(i) for all rows. Steps 184 to 187 are repeated for all stages j=2, . . . , L.

Encoding and Decoding for BCH Components

According to embodiments, for some codes, the matrix H_(i) is not full rank. A decoding algorithm according to an embodiment of the disclosure includes decoding of BCH components with some modifications. Specifically, consider a t-error correcting primitive binary BCH code C of length n=2^(m−1) Assume α is a primitive of the field of size 2^(m)) and that the parity check matrix is given by,

${H = \begin{pmatrix} 1 & \alpha & \ldots & \alpha^{n - 1} \\ 1 & \alpha^{3} & \ldots & \alpha^{3{({n - 1})}} \\ 1 & \vdots & \vdots & \vdots \\ 1 & \alpha^{{2t} - 1} & \ldots & \alpha^{{({{2t} - 1})}{({n - 1})}} \end{pmatrix}},$ where each element from the field is considered as a binary column vector of length m. H may not be full rank. BM decoding requires a syndrome with respect to Has input. For an algorithm according to an embodiment to work, the matrix H should be full rank, otherwise it will not necessarily be possible in the encoding to find a codeword with a pre-determined syndrome.

According to embodiments, a fixed subset of rows of H that are a basis of the row space will be used, and denote the resulting parity check matrix by H′. The missing bits of the syndrome, which are rows in H that do not appear in H′, can be obtained as fixed linear combinations of existing syndrome bits. According to embodiments, there are only minor modifications in the encoding and decoding. For the parity check matrix, H_(i)=(1 α^(ij) α^(i2j) . . . α^(i(n−1)j)), the code is generated by P_(α) _(i) (x), which is the minimal polynomial of α^(i) over the binary field. The dimension of the code is n−deg (P_(α) _(i) ), and the rank of H_(i) is rank(H_(l))=deg (P_(α) _(i) ).

According to an embodiment, consider the parity check matrix H:

$H = \begin{pmatrix} 1 & \alpha^{i_{1}} & \ldots & {\alpha^{i_{1}}}^{n - 1} \\ 1 & \alpha^{i_{2}} & \ldots & \alpha^{i_{2}{({n - 1})}} \\ 1 & \vdots & \vdots & \vdots \\ 1 & \alpha^{i_{p}} & \ldots & \alpha^{i_{p}{({n - 1})}} \end{pmatrix}$ where I={i₁, i₂ . . . i_(p)}⊆{1, 2, . . . , 2t−1}. The generator polynomial is g_(l)(x)=LCM(P_(α) _(i) (x)|i∈I), and the code dimension is n−deg (g_(l)(x)). If α^(i) and α^(j) have the same generator polynomial (i.e., are conjugate), then the rows of H_(i), when regarded as binary matrix, and H_(j) span the same space. If there is a set of elements I such that each element has a different minimal polynomial, then

${{\sum\limits_{i \in I}{\deg\left( P_{\alpha^{i}} \right)}} = {\sum\limits_{i \in I}{{rank}\left( H_{i} \right)}}}\;$ H′ can be obtained by taking for each element with distinct minimal polynomial, but not in the same set of conjugates: H_(i), if the degree of the minimal polynomial is m, or H′_(i) with rank(H_(i))=deg(P_(α) _(i) ) rows, if the degree of the minimal polynomial is smaller than m, which may occur only if m is not prime. According to an embodiment, to find the syndrome H_(x) for some binary vector x of length n, given the shortest syndrome H′_(x), one of the following methods can be used:

(1) Complete the missing entries for all i with minimal polynomial with degree smaller than m by multiplying the syndrome H′_(x) with an appropriate matrix M_(l); or

(2) For all i that is not the smallest in the set of conjugates, the syndrome can be calculated by repeatedly squaring the syndrome of the smallest element in the set, similar to the way even syndromes are calculated from odd syndromes in BM decoding.

Cyclic Codes Property

According to embodiments, for a vector x=(x₁, . . . , x_(n))∈F^(n), the value L(x)=max{1≤j≤n: x≠0}, for the zero vector define L(0)=0, the highest nonzero coordinate.

Lemma:

For a parity check matrix H with size r×n over field F=GF(q) of a cyclic code C, if s is the rank of H, then the first s columns of H are linearly independent.

An algorithm according to an embodiment of the disclosure is as follows. Fix m≥1 and n≤2^(m)−1 and t a positive integer, field F=GF(2^(m)) and let a be a primitive of the field. Consider the BCH check matrix:

$H = {\begin{pmatrix} 1 & \alpha & \ldots & \alpha^{n - 1} \\ 1 & \alpha^{3} & \ldots & \alpha^{3{({n - 1})}} \\ 1 & \vdots & \vdots & \vdots \\ 1 & \alpha^{{2t} - 1} & \ldots & \alpha^{{({{2t} - 1})}{({n - 1})}} \end{pmatrix}.}$ Suppose, for the time being, that H is full ranked with rank t. Now, set r=t·m, the size of the BCH redundancy. Note that by the lemma, for every vector w∈F^(t), there exists a unique binary vector v of length n such that H·v=w and L(v)≤r.

According to an embodiment, fix integer t′, t>t′≥1. The input of an algorithm according to an embodiment is a general vector w∈F^(t), whose first t′ coordinates, each comprising m bits, are zero. An output of an algorithm according to an embodiment is the unique binary vector v of length n such that H·v=w and L(v)≤r.

Consider the m unit vectors of F viewed as in dimensional vector of the linear space GF(2)^(m):

${e_{j} = \left. \begin{pmatrix} 0 \\ \vdots \\ 1 \\ \vdots \\ 0 \end{pmatrix}\leftarrow{{index}\mspace{14mu} j} \right.},$ which corresponds to α^(j). Similarly, consider the zero vector of F as an m dimensional zero vector

$0_{F} = \left. \begin{pmatrix} 0 \\ \vdots \\ 0 \\ \vdots \\ 0 \end{pmatrix}\leftarrow{{index}\mspace{14mu}{m.}} \right.$ Take t″, where t′<t″≤t, and 1≤j≤m, and define a unit vector in F^(t):

${\omega_{{t\;}^{''},}}_{j} = \left. \begin{pmatrix} 0_{F} \\ \vdots \\ e_{j} \\ \vdots \\ 0^{F} \end{pmatrix}\leftarrow{{index}\mspace{14mu}{t^{''}.}} \right.$ Similarly to before, for each j and t″, there exists a unique binary vector u_(t″j) no of length n such that L(u_(t″j))≤r and H·u_(t″j)=ω_(t″j). According to embodiments, the set {u_(t″j)} is referred to as a unit-vectors-solution. For a general vector w, take a sum of unit-vector-solutions as shown in FIG. 20. Unit-Vectors-Solutions Expressed as Polynomial Products

According to embodiments, unit-vectors-solutions can be expressed as polynomial products. For every 1≤t″≤t, let g_(t″)(x) be the polynomial of degree m with coefficients in GF(2) which is the minimal polynomial of α^(t″). Define for 1≤t″≤t: G _(t″)(x)=Π_(1≤s≤t,s≠t″) g _(s)(x), which corresponds to all indices except the one of the unit vector, G ^(z)(x)=Π_(1≤s≤t′) g _(s)(x), which corresponds to all zero indices in the beginning of the vector, and G _(t″) ^(N)(x)=Π_(t′<s≤t,s≠t″) g _(s)(x), which corresponds to all indices after the first t′ zero indices, except the one of the unit vector. Then, G_(t″)(x)=G^(z) (x)G_(t″) ^(N)(x) and deg(G_(t″)(x))=m·(t−1), deg(G^(z)(z))=m·t′, deg(G_(t″) ^(N)(x))=m·(t−t′−1).

According to embodiments, for unit vector solution u_(t″j)=(u_(t″,j, 1), . . . u_(t″,j,n)), define a polynomial U _(t″,j)(x)=Σ_(1≤k≤n) u _(t″,j,k) x ^(k−1). Because L(u_(t″,j))≤r, it follows that this is a polynomial of degree ≤r−1. According to a definition of unit vector solution, U_(t″,j)(α^(s))=0 for all 1≤s≤t, s≠t″. It follows that G_(t″)(x)|U_(t″,j)(x). Thus, there exists a unique polynomial h_(t″,j)(x) with coefficients in GF(2) such that h _(t″,j)(x)·G _(t″)(x)=U _(t″,j)(x), where deg(h_(t″,j)(x))<=r−1−m·(t−1)=mt−1−mt+m=m−1.

According to an embodiment, the memory needed for an algorithm according to an embodiment is as follows. Store in memory G^(z)(x), {G_(t″) ^(N)(x): t′<t″≤t} and {h_(t″,j)(x): t′<t″≤t, 1≤j≤m} and recall that deg(G_(t″) ^(N)(x))=m·(t−t′−1). Thus the memory comprises B bits, where B=m·t′+(t−t′)·((t−t′−1)·m+m²).

General Vector Input

According to an embodiment, a general vector input is as follows. Take an arbitrary vector w=(w₁, . . . , w_(t))∈F^(t). w can be written as a sum of unit vectors: w=Σ _(t′≤t″≤t,1≤j≤m)α_(t″,j)ω_(t″,j), where a_(t″,j) are binary bits comprising the coordinates of w. The output of an algorithm according to an embodiment can be written as a sum of unit-vectors-solutions: w=Σ _(t′≤t″≤t,1≤j≤m) a _(t″,j)ω_(t″,j)=Σ_(t′≤t″≤t,1≤j≤m) a _(t″,j) Hu _(t″,j) =HΣ _(t′≤t″≤t,1≤j≤m) a _(t″,j) u _(t″,j). For t′<t″≤t, define

$v_{t^{''}} = {\sum\limits_{1 \leq j \leq m}{a_{t^{''},j}u_{t^{''},j}}}$ and $v = {\sum\limits_{1 \leq j \leq m}v_{t^{''}}}$ Then: v_(t″)∈GF(2)^(n), L(v_(t)″)≤r, and w=HΣ _(t′≤t″≤t) v _(t″) =Hv. Write a polynomial V(x) as product and sum of polynomials: For t′<t″≤t, V_(t″)(x)=Σ_(1≤k≤n)v_(t″,k)x^(k−1) is the polynomial corresponding to v_(t′). The polynomial corresponding to v is: V(x)=Σ_(t′<t″≤t) V _(t″)(x). Then, it holds for t′<t≤t* that

${V_{t^{''}}(x)} = {{\sum\limits_{1 \leq j \leq m}{a_{t^{''},j}{U_{t^{''},j}(x)}}} = {{\sum\limits_{1 \leq j \leq m}{a_{t^{''},j}{{h_{t^{''},j}(x)} \cdot {G_{t^{''}}(x)}}}} = {{{G_{t^{''}}(x)}{\sum\limits_{1 \leq j \leq m}{a_{t^{''},j}{h_{t^{''},j}(x)}}}} = {{{G^{Z}(x)}{G_{t^{''}}^{N}(x)}{\sum\limits_{1 \leq j \leq m}{a_{t^{''},j}{h_{t^{''},j}(x)}}}} = {{G^{Z}(x)}{W_{t^{''}}(x)}}}}}}$      where $\mspace{79mu}{{W_{t^{''}}(x)} = {{G_{t^{''}}^{N}(x)}{\sum\limits_{1 \leq j \leq m}{a_{t^{''},j}{{h_{t^{''},j}(x)}.}}}}}$ Recall that h_(i″j)(x) are polynomials of degree≤m−1 that are stored in memory. Thus, with m² XOR operations, the function ƒ_(t″)(x) can be computed: ƒ_(t″)(x)=Σ_(1≤j≤m) a _(t″,j) h _(t″,j)(x). With an additional m²·(t−t′−1) XORS, W_(t″)(x) of degree m(t−t′) can be computed: W _(t″)(x)=G _(t″) ^(N)(x)ƒ_(t″)(x) It follows that S={W_(t″)(x)}t′<t″≤t can be computed with m²·(t−t′)² XOR operations. In addition

${V(x)} = {{\sum\limits_{t^{\prime} < t^{''} \leq t}{V_{t^{''}}(X)}} = {{\sum\limits_{t^{\prime} < t^{''} \leq t}{{G^{Z}(x)}{W_{t^{''}}(x)}}} = {{G^{Z}(x)}{\sum\limits_{t^{\prime} < t^{''} \leq t}{W_{t^{''}}(x)}}}}}$ of degree m·t. After computing S, compute

${W(x)} = {\sum\limits_{t^{\prime} < t^{''} \leq t}{W_{t^{''}}(x)}}$ with an additional m·(t−t′)² XOR's and V(x) with a further m²·t′(t−t′) XORs operations. According to an embodiment, an upper bound to the number of XORs required for the computation of V(x) is C=m²·t·(t−t′+1).

According to embodiment, complexity can be reduced with added memory. When two polynomials in GF(2)[x]

${f(x)} = {\sum\limits_{i = 0}^{M}{a_{i}x^{i}}}$ ${g(x)} = {\sum\limits_{i = 0}^{N}{b_{i}x^{i}}}$ are stored in memory, their product requires M×N XORs. Consider a third polynomial

${h(x)} = {\sum\limits_{i = 0}^{N}{x^{i}.}}$ The product h(x)·ƒ(x) is computable with 2(M+N) XORS. Once h(x),·ƒ(x) are given, compute ƒ(x)·g(x) if ham(g(x))≤N/2 with M×N/2 XORs, or ƒ(x)·g(x)=ƒ(x)·(g(x)+h(x))+h(x)·ƒ(x), if ham(g(x))≤N/2 using M×N/2+M+N XORs. h(x)·ƒ(x) can be stored in memory to further reduce the complexity. System Implementations

It is to be understood that embodiments of the present disclosure can be implemented in various forms of hardware, software, firmware, special purpose processes, or a combination thereof. In one embodiment, the present disclosure can be implemented in hardware as an application-specific integrated circuit (ASIC), or as a field programmable gate array (FPGA). In another embodiment, the present disclosure can be implemented in software as an application program tangible embodied on a computer readable program storage device. The application program can be uploaded to, and executed by, a machine comprising any suitable architecture.

FIG. 19 is a block diagram of a of a machine for encoding and decoding BCH codes tailored for a RAID, according to an embodiment of the disclosure. Referring now to FIG. 19, a computer system 191 for implementing the present invention can comprise, inter alia, a central processing unit (CPU) 192, a memory 193 and an input/output (I/O) interface 194. The computer system 191 is generally coupled through the I/O interface 194 to a display 195 and various input devices 196 such as a mouse and a keyboard. The support circuits can include circuits such as cache, power supplies, clock circuits, and a communication bus. The memory 193 can include random access memory (RAM), read only memory (ROM), disk drive, tape drive, etc., or a combinations thereof. The present disclosure can be implemented as a routine 197 that is stored in memory 193 and executed by the CPU 192 to process the signal from the signal source 198. As such, the computer system 191 is a general purpose computer system that becomes a specific purpose computer system when executing the routine 197 of the present invention. Alternatively, as described above, embodiments of the present disclosure can be implemented as an ASIC or FPGA 197 that is in signal communication with the CPU 192 to process the signal from the signal source 198.

The computer system 191 also includes an operating system and micro instruction code. The various processes and functions described herein can either be part of the micro instruction code or part of the application program (or combination thereof) which is executed via the operating system. In addition, various other peripheral devices can be connected to the computer platform such as an additional data storage device and a printing device.

It is to be further understood that, because some of the constituent system components and method steps depicted in the accompanying figures can be implemented in software, the actual connections between the systems components (or the process steps) may differ depending upon the manner in which the present invention is programmed. Given the teachings of the present invention provided herein, one of ordinary skill in the related art will be able to contemplate these and similar implementations or configurations of the present invention.

While the present invention has been described in detail with reference to exemplary embodiments, those skilled in the art will appreciate that various modifications and substitutions can be made thereto without departing from the spirit and scope of the invention as set forth in the appended claims. 

The invention claimed is:
 1. A computer implemented method of encoding generalized concatenated error-correcting codes, comprising the steps of: receiving a codeword {tilde over (C)}_(j) comprising n_(r) rows, wherein n_(r)>=1, of n bits each with k_(M) information bits, k_(M)<n, n>=1, wherein codeword {tilde over (C)}_(j) is a code with parity check matrix $H_{j} = \begin{pmatrix} H_{1} \\ {\overset{\sim}{\Delta}}_{21} \\ {\overset{\sim}{\Delta}}_{32} \\ \vdots \\ {\overset{\sim}{\Delta}}_{{j - 1},j} \end{pmatrix}$ wherein matrix H₁ is the parity check matrix of code C₁, matrix ${{\overset{\sim}{\Delta}}_{{j - 1},j} = \begin{pmatrix} {\overset{\sim}{\Delta}}_{{j - 1},j} \\ {ext}_{j} \end{pmatrix}},$ where {tilde over (Δ)}_(j−1,j) has L_(j) rows and ext_(j) has L_(j)−δ_(j) rows, and matrix Δ_(j−1,j) represents the additional checks for codewords in C_(j) that are not in C_(j−1) and has δ_(j) rows; partitioning the k_(M) information bits into n_(r) blocks, wherein each layer comprises k_(j+1) ^(RS)−k_(j) ^(RS) blocks of {tilde over (k)}_(j) bits each for j=2, . . . , L, wherein L is a number of layers of weak (BCH) code C₁, wherein each layer, except for a first layer, comprises a Reed Solomon (RS) stage followed by a BCH code, and the first layer includes only a BCH code, and {tilde over (k)}_(j) is a dimension of codeword {tilde over (C)}_(j); encoding a first k₂ ^(RS) blocks with a code C₁ and computing syndromes S_(ij)={tilde over (Δ)}S_(j)(x_(i)) wherein a vector of syndromes (S₁₂, …  , S_(k₂^(RS), 2)) is information encoded by Reed Solomon code RS₂, wherein a resulting RS₂ codeword is given by (S₁₂, …  , S_(k₂^(RS), 2), S_(k₂^(RS) + 1, 2), …  , S_(n_(r), 2)); transforming information blocks of size {tilde over (k)}_(j), for j=2, . . . , L and i∈{k_(j) ^(RS)+1, . . . , k_(j+1) ^(RS)} into blocks u_(i), i=1 to n_(r), of size k_(j) using zero padding in coordinates specified by unit vectors; encoding block u_(i) with an encoder for C_(j) to compute codeword x_(i); calculating a vector b of length n−{tilde over (k)}_(j) from ${b = {T_{j}\begin{pmatrix} S_{i\; 2} \\ \vdots \\ S_{i\; j} \end{pmatrix}}},$ wherein matrix T_(j) is defined by R_(j)=(Q_(j)|T_(j)), where Q has n−k_(l) columns, T_(j) has k₁−{tilde over (k)}_(i) columns, and R_(j) is a square matrix of dimension (n−{tilde over (k)}_(j))(n−{tilde over (k)}_(j)) such that R_(j){tilde over (H)}_(j)=(A|I), wherein A is a arbitrary matrix, I is an identity matrix, {tilde over (H)}_(j) is a parity matrix of codeword {tilde over (C)}_(j); updating codeword x_(i) according to ${\left. x_{i}\leftarrow{x_{i} + \begin{pmatrix} 0 \\ M \\ 0 \\ b \end{pmatrix}} \right. = {\begin{pmatrix} x_{1} \\ M \\ x_{{\overset{\sim}{k}}_{j}} \\ x_{{\overset{\sim}{k}}_{j} + 1} \\ M \\ x_{n} \end{pmatrix} + \begin{pmatrix} 0 \\ M \\ 0 \\ b_{1} \\ M \\ b_{n - {\overset{\sim}{k}}_{j}} \end{pmatrix}}};$ and computing syndromes s_(ij′)={tilde over (Δ)}S_(j)(x_(i)) for j′=j+1, . . . , L, wherein a resulting RS_(j+1) codeword is given by (S_(1, j + 1), …  , S_(k_(j + 1)^(RS), j + 1), S_(k_(j + 1)^(RS) + 1, j + 1), …  , S_(n_(r), j + 1))  for  j <  = L − I.
 2. The method of claim 1, further comprising, if parity matrix {tilde over (H)}_(j) is not a full rank matrix, calculating a full rank parity matrix H′_(j) from one of {tilde over (H)}_(j) if a degree of a minimum polynomial for each element is m, wherein m is defined from a length n of a primitive binary BCH code associated with said parity matrix {tilde over (H)}_(j) by n=2^(m−1), and H′_(i) with rank(H_(i))=deg(P_(α) _(i) ) rows if the degree of the minimal polynomial is less than m, wherein P_(α) _(i) (x) is the minimal polynomial of α^(i) over the binary field and a generator polynomial of {tilde over (H)}_(j) is g_(l)(x)=LCM(P_(α) _(i) (x)|i∈l).
 3. A computer implemented method of encoding generalized concatenated error-correcting codes, comprising the steps of: providing a parity matrix {tilde over (H)}_(j) of a j-th layer code and predefined syndrome {tilde over (s)}, wherein syndrome {tilde over (s)} is a vector $\overset{\sim}{s} = \begin{pmatrix} 0 \\ s \end{pmatrix}$ of length n−{tilde over (k)}_(j), in which the first n−k_(l) coordinates are zero, wherein s is a vector of length k₁−{tilde over (k)}_(j), wherein n is a length of a codeword c of a first layer (BCH) code C_(l) of dimension {tilde over (k)}_(j), wherein codeword c satisfies {tilde over (H)}_(j)c={tilde over (s)}, wherein a first layer code includes only a BCH code, and each subsequent layer includes a Reed-Solomon (RS) stage followed by a BCH code; finding a square matrix R_(j) of dimension (n−{tilde over (k)}_(j))(n−{tilde over (k)}_(j)) such that R_(j){tilde over (H)}_(j)=(A|I), wherein A is an arbitrary matrix and I is the identity matrix, wherein R_(j)=(Q_(j)|T_(j)), where Q has n−k_(l) columns and T_(j) has k₁−{tilde over (k)}_(i) columns; finding a vector c=(a b) wherein a is a vector of length {tilde over (k)}_(j) and b is a vector of length n−{tilde over (k)}_(j); and solving ${{\left( A \middle| I \right)\begin{pmatrix} a \\ b \end{pmatrix}} = {{\left( Q_{j} \middle| T_{j} \right)\overset{\sim}{s}} = {{T_{j}s\mspace{14mu}{where}\mspace{14mu} a} = {{0\mspace{14mu}{and}\mspace{14mu} b} = {T_{j}s}}}}},$ wherein a=0 and b=T_(j)s, wherein codeword c is nonzero only on the last n−{tilde over (k)}k_(j)=n−k_(j) bits.
 4. A computer processor configured to execute a program of instructions to perform the method steps for encoding generalized concatenated error-correcting codes, the method comprising the steps of: receiving a codeword {tilde over (C)}_(j) comprising n_(r) rows, wherein n_(r)>=1, of n bits each with k_(M) information bits, k_(M)<n, n>=1, wherein codeword {tilde over (C)}_(j) is a code with parity check matrix ${\overset{\sim}{H}}_{j} = \begin{pmatrix} H_{1} \\ {\overset{\sim}{\Delta}}_{21} \\ {\overset{\sim}{\Delta}}_{32} \\ \vdots \\ {\overset{\sim}{\Delta}}_{{j - 1},j} \end{pmatrix}$ wherein matrix H₁ is the parity check matrix of code C₁, matrix ${{\overset{\sim}{\Delta}}_{{j - 1},j} = \begin{pmatrix} {\overset{\sim}{\Delta}}_{{j - 1},j} \\ {ext}_{j} \end{pmatrix}},$ where {tilde over (Δ)}_(j−i,j) has L_(j) rows and ext_(j) has L_(j)−δ_(j) rows, and matrix Δ_(j−1,j) represents the additional checks for codewords in C_(j) that are not in C_(j−1) and has δ_(j) rows; partitioning the k_(M) information bits into n_(r) blocks, wherein each layer comprises k_(j+1) ^(RS)−k_(j) ^(RS) blocks of {tilde over (k)}_(j) bits each for j=2, . . . , L, wherein L is a number of layers of weak (BCH) code C₁, wherein each layer, except for a first layer, comprises a Reed Solomon (RS) stage followed by a BCH code, and the first layer includes only a BCH code, and {tilde over (k)}_(j) is a dimension of codeword {tilde over (C)}_(j); encoding a first k₂ ^(RS) blocks with a code C₁ and computing syndromes S_(ij)={tilde over (Δ)}S_(j)(x_(i)) wherein a vector of syndromes (S₁₂, …  , S_(k₂^(RS), 2)) is information encoded by Reed Solomon code RS₂, wherein a resulting RS₂ codeword is given by (S₁₂, …  , S_(k₂^(RS), 2), S_(k₂^(RS) + 1, 2), …  , S_(n_(r), 2)); transforming information blocks of size {tilde over (k)}_(j), for j=2, . . . , L and i∈{k_(j) ^(RS)+1, . . . , k_(j+1) ^(RS)} into blocks u_(i), i=1 to n_(r), of size k_(j) using zero padding in coordinates specified by unit vectors; encoding block u_(i) with an encoder for C_(j) to compute codeword x_(i); calculating a vector b of length n−{tilde over (k)}_(j) from ${b = {T_{j}\begin{pmatrix} S_{i\; 2} \\ \vdots \\ S_{i\; j} \end{pmatrix}}},$ wherein matrix T_(j) is defined by R_(j)=(Q_(j)|T_(j)), where Q has n−k₁ columns, T_(j) has k₁−{tilde over (k)}_(j) columns, and R_(j) is a square matrix of dimension (n−{tilde over (k)}_(j))(n−{tilde over (k)}_(j)) such that R_(j){tilde over (H)}_(j)=(A|I), wherein A is an arbitrary matrix, I is an identity matrix, {tilde over (H)}_(j) is a parity matrix of codeword {tilde over (C)}_(j); updating codeword x_(i) according to ${\left. x_{i}\leftarrow{x_{i} + \begin{pmatrix} 0 \\ M \\ 0 \\ b \end{pmatrix}} \right. = {\begin{pmatrix} x_{1} \\ M \\ x_{{\overset{\sim}{k}}_{j}} \\ x_{{\overset{\sim}{k}}_{j} + 1} \\ M \\ x_{n} \end{pmatrix} + \begin{pmatrix} 0 \\ M \\ 0 \\ b_{1} \\ M \\ b_{n - {\overset{\sim}{k}}_{j}} \end{pmatrix}}};$ and computing syndromes S_(ij)={tilde over (Δ)}S_(j)(x_(i)) for j′=j+1, . . . , L, wherein a resulting RS_(j+1) codeword is given by (S_(1, j + 1), …  , S_(k_(j + 1)^(RS), j + 1), S_(k_(j + 1)^(RS) + 1, j + 1), …  , S_(n_(r), j + 1))  for  j <  = L − I.
 5. The computer processor of claim 4, the method further comprising, if parity matrix {tilde over (H)}_(j) is not a full rank matrix, calculating a full rank parity matrix H′_(j) from one of {tilde over (H)}_(j) if a degree of a minimum polynomial for each element is m, wherein m is defined from a length n of a primitive binary BCH code associated with said parity matrix {tilde over (H)}_(j) by n=2^(m−1), and H′_(i) with rank(H_(i))=deg(P_(α) _(i) ) rows if the degree of the minimal polynomial is less than m, wherein P_(α) _(i) (x) is the minimal polynomial of α^(i) over the binary field and a generator polynomial of {tilde over (H)}_(j) is g₁(x)=LCM(P_(α) _(i) (x)|t∈I).
 6. The computer processor of claim 4, wherein the computer processor is one or more of an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), or firmware. 